/****************************************************
	文件：GoalBase.cs
	作者：林文豪
	日期：2021/03/25 22:28:34
	功能：Noting
*****************************************************/
using System;
using System.Collections.Generic;
using MyGame.Character;

namespace MyGame.AI.GOAP {
    public abstract class GoalBase : IGoal {
        public readonly GoapGoalData ExcelData;
        private         Enemy        _Owner;
        
        private   int    _Priority;
        private   bool   _CanInterrupt;
        protected bool   _IsEnd;

        public GoalBase(GoapGoalData excelData,Enemy owner) {
            ExcelData = excelData;
            _Owner    = owner;
        }

        public bool CanInterrupt() {
            return _CanInterrupt;
        }

        public int CompareTo(object obj) {
            throw new NotImplementedException();
        }

        public void FrameFunc() {
            throw new NotImplementedException();
        }

        public int GetPriority() {
            return _Priority;
        }

        public bool IsEnd() {
            return _IsEnd;
        }
        public string GetNodeName() {
            return ExcelData.GoalType.ToString();
        }

        public GoapCondition GetEffects() {
            return ExcelData.Effect == null ? null : GoapFactory.Instance.GenerateCondition(ExcelData.Effect);
        }
        public GoapCondition GetPreconditions() {
            return ExcelData.Precondition == null ? null : GoapFactory.Instance.GenerateCondition(ExcelData.Precondition);
        }
    }
}
